package com.ssfeng.youxia.schedule;

import com.ssfeng.youxia.service.ISessionsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by liyuhang on 2019-09-16.
 */
@Component
public class SessionScheduler {

    private static final Logger logger = LoggerFactory.getLogger(SessionScheduler.class);


    @Autowired
    private ISessionsService sessionsService;
    /***
     * 清除过期session
     */
    public void clearExpiredSessions(){
        logger.info("开始执行定时任务:clearExpiredSessions");
        sessionsService.deleteExpiredSessions();
        logger.info("结束执行定时任务:clearExpiredSessions");
    }
}
